home *** CD-ROM | disk | FTP | other *** search
/ Computer Inter@ctive 16 / Computer Interactive cdrom 16 - dic 98.iso / zdnetit / content / DEVPASCA.ZIP / _SETUP.3 / DevPascal.HLP
Encoding:
Text File  |  1998-05-04  |  3.1 KB  |  71 lines

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
  2. <!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
  3. <HTML>
  4. <HEAD>
  5. <TITLE>Segment_To_Descriptor</TITLE>
  6. <META NAME="description" CONTENT="Segment_To_Descriptor">
  7. <META NAME="keywords" CONTENT="units">
  8. <META NAME="resource-type" CONTENT="document">
  9. <META NAME="distribution" CONTENT="global">
  10. <LINK REL=STYLESHEET HREF="units.css">
  11. </HEAD>
  12. <BODY LANG="EN">
  13.  <A NAME="tex2html2208" HREF="node110.htm"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../buttons/next_motif.gif"></A> <A NAME="tex2html2206" HREF="node87.htm"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../buttons/up_motif.gif"></A> <A NAME="tex2html2200" HREF="node108.htm"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../buttons/previous_motif.gif"></A> <A NAME="tex2html2210" HREF="node1.htm"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="../buttons/contents_motif.gif"></A> <A NAME="tex2html2211" HREF="node361.htm"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../buttons/index_motif.gif"></A> <BR>
  14. <B> Next:</B> <A NAME="tex2html2209" HREF="node110.htm">Get_Next_Selector_Increment_Value</A>
  15. <B>Up:</B> <A NAME="tex2html2207" HREF="node87.htm">Functions and Procedures</A>
  16. <B> Previous:</B> <A NAME="tex2html2201" HREF="node108.htm">Free_Ldt_Descriptor</A>
  17. <BR> <P>
  18. <H2><A NAME="SECTION005322000000000000000">Segment_To_Descriptor</A></H2>
  19. <P>
  20. <A NAME="fuSegmentToDescriptor"> </A>
  21. <A NAME=3325> </A>
  22. <H3><A NAME="SECTION005322100000000000000">Declaration:</A></H3>
  23. <P>
  24. <tt>Function Segment_To_Descriptor  (Seg : Word)  : Word;</tt>
  25. <H3><A NAME="SECTION005322200000000000000">Description:</A></H3>
  26. <P>
  27. <tt>Segment_To_Descriptor</tt> Maps a real mode segment (paragraph) address 
  28. (in <tt>Seg</tt>) onto an descriptor that can be used by a protected mode 
  29. program to access  the same memory.
  30. <P>
  31. The function returns a selector to the DOS real-mode segment.
  32. <P>
  33. <EM>Notes:</EM>
  34. <UL><LI> Only works with real DPMI.<LI> The descriptors limit will be set to 64KB.<LI> multiple calls to this function with the same segment address will
  35.   return the same selector.<LI> Descriptors created by this function can never be modified or freed.
  36. For this reason this function shouldn't be used too often. Programs
  37. which need to examine various real mode addresses using the same
  38. selector should use the function <tt>allocate_ldt_descriptors</tt> and change
  39. the base address as necessary.
  40. </UL><H3><A NAME="SECTION005322300000000000000">Errors:</A></H3>
  41. <P>
  42. None.
  43. <H3><A NAME="SECTION005322400000000000000">See also:</A></H3>
  44. <P>
  45. <DL ><DT><STRONG>Example</STRONG>
  46. <DD>
  47. <PRE>uses go32;
  48.  
  49. var r : trealregs;
  50.     VGAsel : word;
  51.  
  52. begin
  53.      r.realeax := $13; realintr($10, r); 
  54.      { set VGA mode 13h }
  55.      VGASel := segment_to_descriptor($A000);
  56.      {...}
  57.      seg_fillchar(VGAsel, 100*320+6, 1, 15); 
  58.      { put a pixel at (6/100) in color 15 }
  59.      readln;
  60.      {...} 
  61.      r.realeax := $3; realintr($10, r);
  62. end.</PRE>
  63. <P>
  64.  </DL><BR> <HR>
  65. <P><ADDRESS>
  66. <I>Michael Van Canneyt <BR>
  67. Tue Mar 31 16:46:10 CEST 1998</I>
  68. </ADDRESS>
  69. </BODY>
  70. </HTML>
  71.